'use strict';
/**
 * @ngdoc function
 * @name htmsMobileApp.controller:YinhuanCtrl
 * @description
 * # YinhuanCtrl 部门隐患操作的控制器
 * Controller of the htmsMobileApp
 */
angular.module('htmsMobileApp').value("yhListxConfig", {
  template: "views/bumen/yinhuan/tpl/list-tpl.html",
  searchBarTemplate: "views/bumen/yinhuan/tpl/search-bar-tpl.html",
  itemsTemplate: "views/bumen/yinhuan/tpl/items-tpl.html",
  itemTemplate: "views/bumen/yinhuan/tpl/item-tpl.html"
})
  .controller('YinhuanCtrl', function($scope,$log,$modal,$templateCache,CustomHttp,urlObj2Str,yhListxConfig,$location,Authentication) {
    //一般隐患和重大隐患标识,默认为一般隐患:1,重大隐患:2
    $scope.flag = 1;
    $scope.toAddYinhuan = function(){
      $location.path('/addYinhuanBM');
    };
    $scope.toAddXianChangJianCha = function(){
      $location.path('/addXianChangJianCha');
    };

    //设置初始查询的url
    $scope.yhUrl = {
      apiUrl : "/api/yinhuan/list",
      page:1,
      pageSize:5,
      sortType:"id"
    };
    //查询
    $scope.queryYinhuan = function(){
      var addQymcQuery = function(uo){
        if($scope.q.val) {
          if($scope.flag == 1){
            uo.search.push({
              key: "search_LIKE_entBaseInfo.qymc",
              value: $scope.q.val
            });
            uo.search.push({
              key: "search_EQ_yhfj",
              value: 0
            });
          }else {
            uo.search.push({
              key: "search_LIKE_hiddenDdangerRec.entBaseInfo.qymc",
              value: $scope.q.val
            });
            uo.search.push({
              key: "search_EQ_hiddenDdangerRec.yhfj",
              value: 1
            });
          }
        }
      };
      var addHcbm = function(uo){
        if($scope.flag == 1){
          uo.search.push({
            key:"search_EQ_entBaseInfo.hcbm.bmid",value:Authentication.getUser().depid
          });
        }else if($scope.flag == 2){
          uo.search.push({
            key:"search_EQ_hiddenDdangerRec.entBaseInfo.hcbm.bmid",value:Authentication.getUser().depid
          });
        }
      }
      angular.element('#loadingAjaxYihuan').removeAttr("style");
      $scope.$parent.items = null;
      var uo = {
        apiUrl : "/api/yinhuan/list",
        page:1,
        pageSize:5,
        sortType:"id",
        search : []
      };
      if($scope.searchActionItemSelected){
        switch ($scope.searchActionItemSelected.item){
          case "企业名称":  addQymcQuery(uo);break;
          case "待核查": uo.search.push({
            key:"search_EQ_hczt",value:"0"
          });
            uo.search.push({
              key:"search_NEQ_zgzt",value:"3"
            });
            addHcbm(uo);
            addQymcQuery(uo);break;
          case "待复查": uo.search.push({
            key:"search_EQ_fczt",value:"0"
          });
            uo.search.push({
              key:"search_EQ_zgzt",value:"3"
            });
            addHcbm(uo);
            addQymcQuery(uo);break;
          case "一般隐患": uo.apiUrl = "/api/yinhuan/list";
            uo.sortType="scsj";$scope.flag = 1;addQymcQuery(uo);break;
          case "重大隐患": uo.apiUrl = "/api/yinhuan/big/list";
            uo.sortType="id";$scope.flag = 2;addQymcQuery(uo);break;
          default : console.log("查询条件都不匹配");
        }
      }
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.$parent.items = data.content;
        $scope.$parent.first = data.first;
        $scope.$parent.last = data.last;
        $scope.$parent.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxYihuan').css("display","none");
      })

    };

    //$scope.delYinhuan = function(id,yhfj){
    //  if(confirm("确认删除该隐患？此操作将无法恢复！")) {
    //    //重大隐患
    //    if (typeof yhfj == "undefined") {
    //      CustomHttp.del("/api/yinhuan/big/" + id);
    //    }
    //    //一般隐患
    //    else {
    //      CustomHttp.del("/api/yinhuan/" + id);
    //    }
    //  }
    //};
    //下一页
    $scope.nextPage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.yhUrl;
      $scope.items = null;
      angular.element('#loadingAjaxYihuan').removeAttr("style");
      uo.page ++;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxYihuan').css("display","none");
      })
    };
    //上一页
    $scope.prePage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.yhUrl;
      $scope.items = null;
      angular.element('#loadingAjaxYihuan').removeAttr("style");
      uo.page --;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxYihuan').css("display","none");
      })
    };
    //查询过滤方式
    $scope.searchActionItems = ['企业名称', '待核查', '待复查','一般隐患','重大隐患'
      //, '自定义'
    ];
    $scope.searchActionItemSelected = {item : $scope.searchActionItems[0]};
    //触发查询过滤方式
    $scope.doSearch = function(searchActionItem){
      if(searchActionItem=='自定义'){
        var modalInstance = $modal.open({
          //给一个modal框的模板，根据名字获取
          templateUrl: 'myModalContent.html',
          //使用当前的控制器
          controller: 'YinhuanCtrl',
          //给modal框写入一些值
          resolve: {
            searchActionItems: function () {
              return $scope.searchActionItems;
            }
          }
        });

      }
      $scope.searchActionItemSelected = {item : searchActionItem};
    };
    //自定义查询modal框
    $scope.ok = function(){
      console.log("这里是自定义查询操作");
    };
    //自定义查询modal框取消
    $scope.cancel = function(){
      console.log("这里是取消自定义查询的modal框");
    };

    //以下是对列表指令的操作
    $scope.searchBarTemplate = yhListxConfig.searchBarTemplate;
    $scope.itemsTemplate = yhListxConfig.itemsTemplate;
    $scope.itemTemplate = yhListxConfig.itemTemplate;
    $scope.itemTpl = false;
    $scope.q = {val: ""};
    $scope.isSelected = function (item) {
      if (item.selected) {
        return "active"
      }
    };
    $scope.selectItem = function (item) {
      var curItem, _i, _len, _ref;
      _ref = $scope.ngModel;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        curItem = _ref[_i];
        if (curItem.selected) {
          delete curItem.selected
        }
      }
      item.selected = true;
      return $scope.onSelect({item: item})
    };
    this.setItemTemplate = function (tpl, src) {
      $scope.itemTpl = true;
      if (src) {
        $scope.itemTemplate = src
      }
      return $templateCache.put("listxItemTpl", tpl)
    };
  })
  .directive("yhListX", ["CustomHttp", "$templateCache", "yhListxConfig", function (CustomHttp, $templateCache, yhListxConfig) {
    return {
      restrict: "E",
      transclude: true,
      replace: true,
      require: "ngModel",
      scope: {
        title: "@",
        hideSearchBar: "@",
        itemHandlers: "&",
        //loadUrl ngModel 改成双向数据绑定
        loadUrl: "=",
        ngModel: "=",
        onSelect: "&",
        onLoad: "&"
      },
      templateUrl: function (tElement, tAttrs) {
        return yhListxConfig.template
      },
      //列表的所有操作都使用同一个控制器
      controller: "YinhuanCtrl",
      link: function (scope, iElement, iAttrs, controller) {
        //初始化列表数据
        if (scope.loadUrl) {
          CustomHttp.get(scope.loadUrl).success(function (data) {
            scope.ngModel = data.content;
            scope.first = data.first;
            scope.last = data.last;
            //去掉加载中的进度条
            angular.element('#loadingAjaxYihuan').css("display","none");
            return scope.onLoad();
          })
        }
        $(".list-x-main div[ng-transclude]").remove();
        return $(".list-x-main").removeAttr("title")
      }
    }
  }]).directive("yhItemTemplate", function () {
    return {
      restrict: "E",
      replace: true,
      transclude: true,
      require: "^yhListX",
      scope: {itemTemplate: "@"},
      template: "<div ng-transclude></div>",
      link: function (scope, iElement, iAttrs, controller) {
        return controller.setItemTemplate(iElement.html(), scope.itemTemplate)
      }
    }
  }).controller('YihuanDetailCtrl',function($scope,$routeParams,$location,CustomHttp,Authentication){
    $scope.isHcFc = false;
    $scope.active = false;
    $scope.sftghcfc = 1;
    var r1 = new RegExp("/yinhuanHecha/*");
    var r2 = new RegExp("/yinhuanFucha/*");
    var yhid = $routeParams.yhid;
    var path = $location.path();
    if(r1.test(path) || r2.test(path)){
      $scope.isHcFc = true;
      $scope.active = true;
      if(r1.test(path)){
        $scope.hcfcTitle = "核查";
        $scope.sendHcFc = function(){
          var shyj = angular.element('#shyj').val();
          var sftghcfc = angular.element('#sftghcfc').val();
          CustomHttp.post("/api/yinhuan/hc/"+Authentication.getUser().id+"/"+yhid+"/"+sftghcfc,shyj)
            .success(function(data){
              alert("发送成功!");
              $location.path("/yinhuan/"+$routeParams.yhid);
            });
        };
      }else{
        $scope.hcfcTitle = "复查";
        $scope.sendHcFc = function(){
          var shyj = angular.element('#shyj').val();
          var sftghcfc = angular.element('#sftghcfc').val();
          CustomHttp.post("/api/yinhuan/fc/"+Authentication.getUser().id+"/"+yhid+"/"+sftghcfc,shyj)
            .success(function(data){
              alert("发送成功!");
              $location.path("/yinhuan/"+$routeParams.yhid);
            });
        };
      }
    }
    $scope.title = "一般隐患信息查看";
    CustomHttp.get('/api/yinhuan/'+yhid).
      success(function(data) {
        $scope.baseInfo = data;
      });
    CustomHttp.get('/api/yinhuan/image/'+yhid + "/yhtpwjh").
      success(function(data) {
        $scope.yhtp = data;//隐患图片信息
      });
    CustomHttp.get('/api/yinhuan/image/'+yhid + "/zghtpwjh").
      success(function(data) {
        $scope.zgtp = data;//整改图片信息
      });
    //获取隐患审核意见历史信息
    CustomHttp.get('/api/yinhuan/history/list/'+yhid).
      success(function(data){
        $scope.historys = data;
      });

  }).controller('BigyihuanDetailCtrl',function($scope,$routeParams,$location,CustomHttp,Authentication){
    $scope.isHcFc = false;
    $scope.active = false;
    $scope.sftghcfc = 1;
    var yhid = $routeParams.yhid;
    $scope.title = "重大隐患信息查看";
    CustomHttp.get('/api/yinhuan/big/'+yhid).
      success(function(data) {
        $scope.baseInfo = data;
        yhid = data.hiddenDdangerRec.id;
        $scope.isHcFc = false;
        var r1 = new RegExp("/yinhuanHecha/big/*");
        var r2 = new RegExp("/yinhuanFucha/big/*");
        var path = $location.path();
        if(r1.test(path) || r2.test(path)){
          $scope.isHcFc = true;
          $scope.active = true;
          if(r1.test(path)){
            $scope.hcfcTitle = "核查";
            $scope.sendHcFc = function(){
              var shyj = angular.element('#shyj').val();
              var sftghcfc = angular.element('#sftghcfc').val();
              CustomHttp.post("/api/yinhuan/hc/"+Authentication.getUser().id+"/"+yhid+"/"+sftghcfc,shyj)
                .success(function(data){
                  alert("发送成功!");
                  $location.path("/yinhuan/big/"+$routeParams.yhid);
                });
            };
          }else{
            $scope.hcfcTitle = "复查";
            $scope.sendHcFc = function(){
              var shyj = angular.element('#shyj').val();
              var sftghcfc = angular.element('#sftghcfc').val();
              CustomHttp.post("/api/yinhuan/fc/"+Authentication.getUser().id+"/"+yhid+"/"+sftghcfc,shyj)
                .success(function(data){
                  alert("发送成功!");
                  $location.path("/yinhuan/big/"+$routeParams.yhid);
                });

            };
          }
        }
          CustomHttp.get('/api/yinhuan/image/'+yhid + "/yhtpwjh").
            success(function(data) {
              $scope.yhtp = data;//隐患图片信息
            });
        CustomHttp.get('/api/yinhuan/image/'+yhid + "/zghtpwjh").
          success(function(data) {
            $scope.zgtp = data;//整改图片信息
          });
        //获取隐患审核意见历史信息
        CustomHttp.get('/api/yinhuan/history/list/'+yhid).
          success(function(data){
            $scope.historys = data;
          });
      });

  }).controller('AddYinhuanBMCtrl',function($scope,$log,$modal,$templateCache,CustomHttp,urlObj2Str,$location){
    $scope.toAddYinhuan = function(qyid){
      console.log(qyid);
      $location.path('/addYinhuan/'+ qyid);
    };
    //设置初始查询的url
    $scope.entsUrl = {
      apiUrl : "/api/entBaseInfo/list",
      page:1,
      pageSize:5,
      sortType:"qyid",
      search : [{
        key:"search_EQ_qyzt",value:"1"
      },{
        key:"search_LTE_qylxxx",value:"1"
      },{
        key:"search_EQ_sftgcs",value:"1"
      }]
    };
    var u = urlObj2Str.getUrlStr($scope.entsUrl);
    CustomHttp.get(u).success(function (data) {
      $scope.items = data.content;
      $scope.uo = $scope.entsUrl;
      //去掉加载中的进度条
      angular.element('#loadingAjaxEntBaseInfo').css("display","none");
    })
    //查询
    $scope.queryEnts = function(){
      angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      $scope.items = null;
      var uo = {
        apiUrl : "/api/entBaseInfo/list",
        page:1,
        pageSize:5,
        sortType:"qyid",
        search : [{
          key: "search_LIKE_qymc",
          value: $scope.q.val
        }]
      };

      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxEntBaseInfo').css("display","none");
      })

    };
    //下一页
    $scope.nextPage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.entsUrl;
      $scope.items = null;
      angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      uo.page ++;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxEntBaseInfo').css("display","none");
      })
    };
    //上一页
    $scope.prePage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.entsUrl;
      $scope.items = null;
      angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      uo.page --;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxEntBaseInfo').css("display","none");
      })
    };
  }).controller('AddXianChangJianChaCtrl',function($scope,$log,$modal,$templateCache,CustomHttp,urlObj2Str,$location){
    $scope.toAddXianChangJianChaInfo = function(qyid){
      console.log(qyid);
      $location.path('/addXianChangJianChaInfo/'+ qyid);
    };
    //设置初始查询的url
    $scope.entsUrl = {
      apiUrl : "/api/entBaseInfo/list",
      page:1,
      pageSize:5,
      sortType:"qyid",
      search : [{
        key:"search_EQ_qyzt",value:"1"
      },{
        key:"search_LTE_qylxxx",value:"1"
      },{
        key:"search_EQ_sftgcs",value:"1"
      }]
    };
    var u = urlObj2Str.getUrlStr($scope.entsUrl);
    CustomHttp.get(u).success(function (data) {
      $scope.items = data.content;
      $scope.uo = $scope.entsUrl;
      //去掉加载中的进度条
      angular.element('#loadingAjaxEntBaseInfo').css("display","none");
    })
    //查询
    $scope.queryEnts = function(){
      angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      $scope.items = null;
      var uo = {
        apiUrl : "/api/entBaseInfo/list",
        page:1,
        pageSize:5,
        sortType:"qyid",
        search : [{
          key: "search_LIKE_qymc",
          value: $scope.q.val
        }]
      };

      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxEntBaseInfo').css("display","none");
      });

    };
    //下一页
    $scope.nextPage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.entsUrl;
      $scope.items = null;
      angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      uo.page ++;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxEntBaseInfo').css("display","none");
      })
    };
    //上一页
    $scope.prePage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.entsUrl;
      $scope.items = null;
      angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      uo.page --;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.items = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        angular.element('#loadingAjaxEntBaseInfo').css("display","none");
      })
    };
  }).controller('AddXianChangJianChaInfoCtrl',function($scope,$location,$routeParams,$upload,CustomHttp,RouteFilter,urlObj2Str,Authentication,serverAddr) {
    CustomHttp.get("/api/entBaseInfo/"+$routeParams.qyid).success(function(data){
      $scope.entBaseInfo = data;
    });
    CustomHttp.get("/api/entProAddress/findByQyid/"+$routeParams.qyid).success(function(data){
       $scope.entProAddress = data;
    });
    var now = new Date();
    var year = now.getFullYear();
    var yearList = [];
    for(var i = 0;i <= 30;i++){
      yearList.push(year+i);
    }
    $scope.yearList = yearList;

    $scope.isShangBaoXCJC=false;
    $scope.isShowQuery1=false;
    $scope.isShowQuery2=false;
    $scope.isShowQuery3=false;

    $scope.toAddDmt1=function(id,name){
      $scope.zfdw=name;
      $scope.zfdwid=id;
      $scope.isShowQuery1=false;
    };

    $scope.toAddDmt2=function(id,name){
      $scope.cyjcdw=name;
      $scope.cyjcdwid=id;
      $scope.isShowQuery2=false;
    };

    $scope.toAddDmt3=function(id,name){
      $scope.qxdw=name;
      $scope.qxdwid=id;
      $scope.isShowQuery3=false;
    };
    $scope.q1={};
    $scope.q1.val="";
    $scope.q2={};
    $scope.q2.val="";
    $scope.q3={};
    $scope.q3.val="";
    $scope.chekType = [{key:"日常抽查",value:1},{key:"专项检查",value:2}];

    $scope.xcjcMode={};
    $scope.xcjcMode.zfdw;
    $scope.dfUo = {//默认查询
      apiUrl : "/api/department/list",
      page:1,
      pageSize:5,
      sortType:"bmid",
      search : [{
      }]
    };

    $scope.queryDepartment=function(name){
      $scope.loadDiv.removeAttr('style');
      $scope.items = null;
      var uo = {
        apiUrl : "/api/department/list",
        page:1,
        pageSize:5,
        sortType:"bmid",
        search : [{
          key: "search_LIKE_bmmc",
          value: name
        }]
      };


      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.department=data.content;
        $scope.uo = uo;
        //去掉加载中的进度条
        $scope.loadDiv.css("display","none");
        //alert("未查询到结果！");
      });
    };

    $scope.queryEnts1=function(){//查询 执法单位
      $scope.loadDiv=angular.element('#loadAjax1');
      $scope.queryDepartment($scope.q1.val);
    };
    $scope.queryEnts2=function(){//查询
      $scope.loadDiv=angular.element('#loadAjax2');
      $scope.queryDepartment($scope.q2.val);
    };
    $scope.queryEnts3=function(){//查询
      $scope.loadDiv=angular.element('#loadAjax3');
      $scope.queryDepartment($scope.q3.val);
    };

    //下一页
    $scope.nextPage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.entsUrl;
      $scope.items = null;
      //angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      $scope.loadDiv.removeAttr("style");
      uo.page ++;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.department= data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
        //angular.element('#loadingAjaxEntBaseInfo').css("display","none");
        $scope.loadDiv.css("display","none");
      })
    };
    //上一页
    $scope.prePage = function (){
      var uo;
      if($scope.uo)
        uo = $scope.uo;
      else uo = $scope.dfUo;
      $scope.items = null;
      //angular.element('#loadingAjaxEntBaseInfo').removeAttr("style");
      $scope.loadDiv.removeAttr("style");
      uo.page --;
      var u = urlObj2Str.getUrlStr(uo);
      CustomHttp.get(u).success(function (data) {
        $scope.department = data.content;
        $scope.first = data.first;
        $scope.last = data.last;
        $scope.uo = uo;
        //去掉加载中的进度条
       /// angular.element('#loadingAjaxEntBaseInfo').css("display","none");
        $scope.loadDiv.css("display","none");
      })
    };

    $scope.shangBaoXCJC=function(){
      $scope.xcjcMode.cyjcrs=parseInt($scope.xcjcMode.cyjcrs);
      $scope.xcjcMode.jclx=parseInt($scope.xcjcMode.jclx);
      var match = function(zgwcrq){
        return /\d{4}-\d{2}-\d{2}/.test(zgwcrq);
      };

      $scope.xcjcMode.kssj=$scope.dateY + "-" + $scope.dateM + "-" + $scope.dateD;
      if(!match($scope.dateY + "-" + $scope.dateM + "-" + $scope.dateD)){
        $scope.xcjcMode.kssj=null;
      }
      $scope.xcjcMode.jssj=$scope.dateY2 + "-" + $scope.dateM2 + "-" + $scope.dateD2;
      if(!match($scope.dateY2 + "-" + $scope.dateM2 + "-" + $scope.dateD2)){
        $scope.xcjcMode.jssj=null;
      }

      $scope.xcjcMode.jcry=Authentication.getUser().name;

      $scope.xcjcMode.entBaseInfo={qyid:$scope.entBaseInfo.qyid};
      $scope.xcjcMode.sysDep={bmid:parseInt($scope.zfdwid)};//执法部门};
      $scope.xcjcMode.cyjcdw=$scope.cyjcdw;//参与检查单位
      $scope.xcjcMode.entProAddress={id:parseInt($scope.jccs)};

      $scope.xcjcMode.qxdw=$scope.qxdw;//qxdwid;
      CustomHttp.post("/api/yinhuan/checkRecord/create/"+Authentication.getUser().id,$scope.xcjcMode).success(function(data){
        alert("上报成功！");
      });
    };
    $scope.shangBaoWJ=function(){

    };



  });
